<template>
  <div style="height: 100%;">
      <div class="msg-text">有以下接口连接失败，请通知管理员检查，否则将造成无法正常计价、系统卡顿、结果无法发布到HIS等后果！</div>
      <div class="msg-tabel">
          <vxe-table :loading="loading" :data.sync="tableData" border height="auto" header-align="center" highlight-current-row highlight-hover-row ref="xTable" resizable show-header-overflow="tooltip" size="mini" stripe>
              <vxe-table-column field="his_name" title="接口名称" width="120" sortable> </vxe-table-column>
              <vxe-table-column field="msg" title="提示消息" sortable></vxe-table-column>
          </vxe-table>
      </div>
  </div>
</template>
<script type="text/javascript">
export default {
  name: "hisinterface",
  data() {
      return {
          msgtype: this.$route.params.p1,
          loading: false,
          tableData: []
      };
  },
  mounted() {
      console.log(this.$route.params);
      this.$route.params.p1 = "1";
      this.getmsgmain(this.$route.params);
  },
  methods: {
      getmsgmain(params) {
          this.tableData = [];
          this.$tool
              .request({
                  url: "ucent/alertmsg",
                  method: "post",
                  data: {
                      params: params
                  }
              })
              .then(res => {
                  this.tableData = res.data;
              })
              .catch(e => {});
          setTimeout(() => {
              this.getmsgmain(params);
          }, 300000); //5分钟刷新一下
      }
  }
};
</script>

<style scoped>
.msg-text {
  color: red;
  height: 150px;
  border: solid 1px #ccc;
  margin: 0 5px 5px 5px;
  padding: 2px;
}
.msg-tabel {
  margin: 0 5px;
  height: calc(100% - 157px);
}
</style>
